﻿@model IEnumerable<GroceryPriceBook.Core.ViewModel.Product>

@{
	ViewBag.Title = "Index";
}

<div class="row">
	<div class="large-12">
		<div class="row">
			<div class="large-12">
				<p>
					@Html.ActionLink("Create New", "Create")
				</p>
			</div>
		</div>
		<div class="row">
			<div class="large-12">
				<table>
					<thead>
						<tr>
							<th>
								@Html.DisplayNameFor(model => model.IsActive)
							</th>
							<th>
								@Html.DisplayNameFor(model => model.ProductCategory.Name)
							</th>
							<th>
								@Html.DisplayNameFor(model => model.ProductManufacturer.Name)
							</th>
							<th>
								@Html.DisplayNameFor(model => model.Name)
							</th>
							<th>
								@Html.DisplayNameFor(model => model.Amount)
							</th>
							<th>Weight / Volume Unit
							</th>
							<th>
								@Html.DisplayNameFor(model => model.Quantity)
							</th>
							<th>Count / Quantity Unit
							</th>

							<th></th>
						</tr>
					</thead>
					<tbody>

						@foreach (var item in Model)
						{
							<tr>
								<td>
									@Html.DisplayFor(modelItem => item.IsActive)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.ProductCategory.Name)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.ProductManufacturer.Name)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.Name)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.Amount)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.ProductAmountUnit.Name)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.Quantity)
								</td>
								<td>
									@Html.DisplayFor(modelItem => item.ProductQuantityUnit.Name)
								</td>
								<td>
									@Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
									@Html.ActionLink("Details", "Details", new { id = item.Id }) |
									@Html.ActionLink("Delete", "Delete", new { id = item.Id })
								</td>
							</tr>
						}
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
